<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.linenumber {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='linenumber'>  1</span> <span class="COMM">/*2112Widget*/</span><span class="WHIT">
<span class='linenumber'>  2</span> 
<span class='linenumber'>  3</span> 
<span class='linenumber'>  4</span> </span><span class="NAME">YAHOO.widget._2112SnapInPanel_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">el</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userConfig</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>  5</span> 
<span class='linenumber'>  6</span> </span><span class="WHIT">               </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>  7</span> </span><span class="WHIT">                  </span><span class="NAME">this.WindowName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">el</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">                   </span><span class="WHIT">
<span class='linenumber'>  8</span> </span><span class="WHIT">						</span><span class="NAME">YAHOO.widget._2112SnapInPanel_.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">el</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">userConfig</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">                  </span><span class="WHIT">
<span class='linenumber'>  9</span> </span><span class="WHIT">					</span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 10</span> </span><span class="WHIT">          </span><span class="COMM">//the widgets position</span><span class="WHIT">
<span class='linenumber'> 11</span> </span><span class="WHIT">               </span><span class="WHIT">
<span class='linenumber'> 12</span> </span><span class="WHIT">               </span><span class="NAME">this.unload</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//OVERRIDE this method to unload your SnapIn</span><span class="WHIT">
<span class='linenumber'> 13</span> </span><span class="WHIT">               </span><span class="NAME">this.drop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 14</span> 
<span class='linenumber'> 15</span> </span><span class="WHIT">               </span><span class="NAME">this.getWindowExtY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 16</span> </span><span class="WHIT">               </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 17</span> 
<span class='linenumber'> 18</span> </span><span class="WHIT">                  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Event.isIE</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 19</span> </span><span class="WHIT">                     </span><span class="KEYW">return</span><span class="WHIT">  </span><span class="NAME">this.header.offsetHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.body.children</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">offsetHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.footer.offsetHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 20</span> </span><span class="WHIT">                  </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 21</span> </span><span class="WHIT">                     </span><span class="KEYW">return</span><span class="WHIT">  </span><span class="NAME">this.body.firstChild.clientHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.header.clientHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.footer.clientHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 22</span> </span><span class="COMM">//</span><span class="WHIT">
<span class='linenumber'> 23</span> 
<span class='linenumber'> 24</span> </span><span class="WHIT">                    </span><span class="WHIT">
<span class='linenumber'> 25</span> 
<span class='linenumber'> 26</span> </span><span class="WHIT">               </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 27</span> 
<span class='linenumber'> 28</span> </span><span class="WHIT">               </span><span class="NAME">this.getBodyHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 29</span> </span><span class="WHIT">               </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 30</span> </span><span class="WHIT">                  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Event.isIE</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 31</span> </span><span class="WHIT">                     </span><span class="KEYW">return</span><span class="WHIT">  </span><span class="NAME">this.body.children</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">offsetHeight</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 32</span> </span><span class="WHIT">                  </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 33</span> </span><span class="WHIT">                     </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.body.firstChild.clientHeight</span><span class="WHIT">
<span class='linenumber'> 34</span> </span><span class="WHIT">               </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 35</span> 
<span class='linenumber'> 36</span> </span><span class="WHIT">               </span><span class="NAME">this.calcBodyHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">iSnapInTargetHeight</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 37</span> </span><span class="WHIT">               </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">//border = 4</span><span class="WHIT">
<span class='linenumber'> 38</span> 
<span class='linenumber'> 39</span> 
<span class='linenumber'> 40</span> </span><span class="COMM">//alert(iSnapInTargetHeight + "/" + this.header.clientHeight + "/" +  this.footer.clientHeight) ;</span><span class="WHIT">
<span class='linenumber'> 41</span> 
<span class='linenumber'> 42</span> </span><span class="WHIT">                  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Event.isIE</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 43</span> </span><span class="WHIT">                     </span><span class="KEYW">return</span><span class="WHIT">  </span><span class="NAME">iSnapInTargetHeight</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT">  </span><span class="PUNC">(</span><span class="NUMB">4</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.header.offsetHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.footer.offsetHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 44</span> </span><span class="WHIT">                  </span><span class="KEYW">else</span><span class="WHIT">                    </span><span class="WHIT">
<span class='linenumber'> 45</span> </span><span class="WHIT">                     </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">iSnapInTargetHeight</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT">   </span><span class="PUNC">(</span><span class="NUMB">12</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.header.clientHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.footer.clientHeight</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 46</span> </span><span class="WHIT">               </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 47</span> </span><span class="WHIT">               </span><span class="WHIT">
<span class='linenumber'> 48</span> 
<span class='linenumber'> 49</span> </span><span class="WHIT">            </span><span class="NAME">this.beforeHideEvent.subscribe</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">                        </span><span class="WHIT">
<span class='linenumber'> 50</span> </span><span class="WHIT">                        </span><span class="NAME">this.unload</span><span class="PUNC">(</span><span class="NAME">this.WindowName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">                     </span><span class="WHIT">
<span class='linenumber'> 51</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 52</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'> 53</span> 
<span class='linenumber'> 54</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 55</span> </span><span class="NAME">YAHOO.extend</span><span class="PUNC">(</span><span class="NAME">YAHOO.widget._2112SnapInPanel_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">YAHOO.widget.Panel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 56</span> 
<span class='linenumber'> 57</span> </span><span class="NAME">onSnapInLoaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">myPanel</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 58</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 59</span> </span><span class="WHIT">  </span><span class="COMM">//Workaround: Firefox will show double scrollbars till Framewidth is set properly</span><span class="WHIT">
<span class='linenumber'> 60</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Event.isIE</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 61</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 62</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">myIFrame</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="NAME">myPanel.WindowName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'_iFrame'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 63</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">myIFrame</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 64</span> </span><span class="WHIT">	</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 65</span> </span><span class="WHIT">      </span><span class="NAME">myIFrame.height</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'100%'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 66</span> </span><span class="WHIT">		</span><span class="NAME">myIFrame.width</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'100%'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 67</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 68</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 69</span> 
<span class='linenumber'> 70</span> 
<span class='linenumber'> 71</span> </span><span class="COMM">//theContent -> also used to host other resources (like a menubar);</span><span class="WHIT">
<span class='linenumber'> 72</span> </span><span class="COMM">//but would be HTML in most cases.</span><span class="WHIT">
<span class='linenumber'> 73</span> </span><span class="NAME">onSnapInAvail</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">myPanel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">snapInID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theContent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">myName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">myTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 74</span> </span><span class="WHIT">                          </span><span class="NAME">strWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bNoBounds</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 75</span> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 76</span> </span><span class="WHIT">  </span><span class="NAME">myPanel.setHeader</span><span class="PUNC">(</span><span class="STRN">"&lt;div class='tl'>&lt;/div>&lt;span>"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">myTitle</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" &lt;/span>&lt;div class='tr'>&lt;/div>"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 77</span> 
<span class='linenumber'> 78</span> </span><span class="WHIT">  </span><span class="COMM">//if(theContent.substr(0, 6) == '&lt;embed')</span><span class="WHIT">
<span class='linenumber'> 79</span> </span><span class="WHIT">  </span><span class="COMM">//theContent.replace(/>/g,"wmode=\"transparent\">") ;</span><span class="WHIT">
<span class='linenumber'> 80</span> 
<span class='linenumber'> 81</span> </span><span class="WHIT">  </span><span class="NAME">myPanel.setBody</span><span class="PUNC">(</span><span class="NAME">theContent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'> 82</span> </span><span class="WHIT">  </span><span class="NAME">myPanel.setFooter</span><span class="PUNC">(</span><span class="STRN">"&lt;div id=\"nls2112_ResizeFooter\">&lt;/div>"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 83</span> </span><span class="WHIT"> </span><span class="NAME">myPanel.render</span><span class="PUNC">(</span><span class="NAME">document.body</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'> 84</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">bNoBounds</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 85</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 86</span> </span><span class="WHIT">    </span><span class="NAME">myPanel.body.style.overflow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'visible'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 87</span> </span><span class="WHIT">    </span><span class="NAME">myPanel.footer.style.visibility</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'hidden'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 88</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 89</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">headerHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">myPanel.header.offsetHeight</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 90</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bodyHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">myPanel.calcBodyHeight</span><span class="PUNC">(</span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">strHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">//( parseInt(strHeight, 10) - myPanel.footer.offsetHeight - myPanel.header.offsetHeight - 13);</span><span class="WHIT">
<span class='linenumber'> 91</span> </span><span class="WHIT"> </span><span class="COMM">//alert(snapInID + " BodyHeight:  " + bodyHeight) ;</span><span class="WHIT">
<span class='linenumber'> 92</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">bodyHeight</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 93</span> </span><span class="WHIT">			</span><span class="NAME">bodyHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 94</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 95</span> 
<span class='linenumber'> 96</span> </span><span class="WHIT">  </span><span class="NAME">myPanel.body.style.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bodyHeight</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 97</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'> 98</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 99</span> </span><span class="WHIT">  </span><span class="NAME">myPanel.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>100</span> 
<span class='linenumber'>101</span> 
<span class='linenumber'>102</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>103</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>104</span> </span><span class="COMM">//nobounds -> content may exceed bounds (like drop down menu)</span><span class="WHIT">
<span class='linenumber'>105</span> </span><span class="NAME">initSnapIn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">cbDrag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">cbDrop</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">cbUnload</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theContent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">snapInID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>106</span> </span><span class="WHIT">                        </span><span class="NAME">iPreferredWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">unitW</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iPreferredHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">unitH</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bNoBounds</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bCanClose</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>107</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>108</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>109</span> 
<span class='linenumber'>110</span> </span><span class="WHIT">     </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">myPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>111</span> </span><span class="WHIT">	         </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">YAHOO.widget._2112SnapInPanel_</span><span class="PUNC">(</span><span class="NAME">snapInID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>112</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">iframe</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">position</span><span class="PUNC">:</span><span class="STRN">"absolute"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">width</span><span class="PUNC">:</span><span class="NAME">iPreferredWidth</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">unitW</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">iPreferredHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">unitH</span><span class="PUNC">,</span><span class="WHIT">                        </span><span class="WHIT">
<span class='linenumber'>113</span> </span><span class="WHIT">           </span><span class="NAME">close</span><span class="PUNC">:</span><span class="NAME">bCanClose</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">visible</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">constraintoviewport</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>114</span> </span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>115</span> </span><span class="WHIT">     </span><span class="NAME">myPanel.draggable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">                         </span><span class="WHIT">
<span class='linenumber'>116</span> </span><span class="WHIT">     </span><span class="NAME">myPanel.WindowName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">snapInID</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>117</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>118</span> </span><span class="WHIT">     </span><span class="COMM">//important: do the onPanelAvail before Repos (Header would not be set).</span><span class="WHIT">
<span class='linenumber'>119</span> </span><span class="WHIT">     </span><span class="NAME">myDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">onSnapInAvail</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">myPanel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">snapInID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theContent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">snapInID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>120</span> </span><span class="WHIT">                              </span><span class="NAME">iPreferredWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iPreferredHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bNoBounds</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>121</span> </span><span class="WHIT">     </span><span class="COMM">//the unload Callback</span><span class="WHIT">
<span class='linenumber'>122</span> </span><span class="WHIT">     </span><span class="NAME">myPanel.unload</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cbUnload</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>123</span> </span><span class="WHIT">     </span><span class="NAME">myPanel.drop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cbDrop</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>124</span> </span><span class="WHIT">     </span><span class="NAME">myPanel.drag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cbDrag</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>125</span> </span><span class="WHIT">     </span><span class="NAME">myPanel.dd.endDrag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>126</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.clientX</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//savcopy</span><span class="WHIT">
<span class='linenumber'>127</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.clientY</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>128</span> </span><span class="WHIT">            </span><span class="NAME">myPanel.syncPosition</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>129</span> </span><span class="WHIT">            </span><span class="NAME">myPanel.drop</span><span class="PUNC">(</span><span class="NAME">myPanel.WindowName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">dropx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">dropy</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">myPanel.body.clientWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">myPanel.body.clientHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//which is not correct, since coordinates differ slightly</span><span class="WHIT">
<span class='linenumber'>130</span> </span><span class="WHIT">			   </span><span class="COMM">//alert(e.pageY + ' endDrag') ;</span><span class="WHIT">
<span class='linenumber'>131</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>132</span> </span><span class="WHIT">     </span><span class="NAME">myPanel.dragEvent.subscribe</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">             </span><span class="WHIT">
<span class='linenumber'>133</span> </span><span class="WHIT">           </span><span class="NAME">myPanel.drag</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//which is not correct, since coordinates differ slightly         </span><span class="WHIT">
<span class='linenumber'>134</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>135</span> 
<span class='linenumber'>136</span> 
<span class='linenumber'>137</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>138</span> 
<span class='linenumber'>139</span> 
<span class='linenumber'>140</span> </span><span class="WHIT"> 	  </span><span class="NAME">onSnapInLoaded</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">myPanel</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>141</span> 
<span class='linenumber'>142</span> </span><span class="WHIT">     </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">myPanel</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//important, so SIMs could apply some logic to the Panel</span><span class="WHIT">
<span class='linenumber'>143</span> 
<span class='linenumber'>144</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>145</span> </span></pre></body></html>